function checkScroll() {
    // 处理普通图片容器（除了第一个容器和容器4）
    const normalContainers = document.querySelectorAll('.image-wrapper:not(.content-wrapper):not(:first-child)');
    const windowHeight = window.innerHeight;
    const triggerPoint = windowHeight * (2/3);
    
    normalContainers.forEach(element => {
        const elementRect = element.getBoundingClientRect();
        const elementTop = elementRect.top;
        
        if (elementTop <= triggerPoint) {
            element.classList.remove('fade-up-hidden');
            element.classList.add('fade-up-show');
        } else if (elementTop > windowHeight) {
            element.classList.remove('fade-up-show');
            element.classList.add('fade-up-hidden');
        }
    });

    // 只处理容器4内部的内容组
    const contentGroups = document.querySelectorAll('.content-wrapper .content-group');
    contentGroups.forEach(group => {
        const elementRect = group.getBoundingClientRect();
        const elementTop = elementRect.top;
        
        if (elementTop <= triggerPoint) {
            group.classList.remove('fade-up-hidden');
            group.classList.add('fade-up-show');
        } else if (elementTop > windowHeight) {
            group.classList.remove('fade-up-show');
            group.classList.add('fade-up-hidden');
        }
    });
}

// 初始化时添加隐藏类并触发第一个容器的动画
document.addEventListener('DOMContentLoaded', () => {
    // 初始化普通图片容器（除了第一个容器）
    const normalContainers = document.querySelectorAll('.image-wrapper:not(.content-wrapper):not(:first-child)');
    normalContainers.forEach(element => {
        element.classList.add('fade-up-hidden');
    });

    // 只初始化容器4内部的内容组
    const contentGroups = document.querySelectorAll('.content-wrapper .content-group');
    contentGroups.forEach(group => {
        group.classList.add('fade-up-hidden');
    });
    
    // 立即触发第一个容器的动画
    const firstContainer = document.querySelector('.image-wrapper:first-child');
    if (firstContainer) {
        firstContainer.classList.add('fade-up-show');
    }
    
    checkScroll(); // 检查其他容器的初始状态
});

// 添加滚动监听
window.addEventListener('scroll', checkScroll); 